//
//  SSWBDemoViewController.swift
//  shanshanlol微博
//
//  Created by 叶竞泽 on 2017/1/9.
//  Copyright © 2017年 JingZe. All rights reserved.
//

import UIKit

class SSWBDemoViewController: SSWBBaseViewController {
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // 设置标题
        title = "第\((navigationController?.childViewControllers.count)! - 1)个"
    }

    // MARK: - 监听方法
    
    @objc fileprivate func dismissMe() {
        dismiss(animated: true, completion: nil)
    }

    /// 继续push一个新的控制器
    @objc fileprivate func showNext() {
        let vc = SSWBDemoViewController()
        navigationController?.pushViewController(vc, animated: true)
    }
    
    @objc fileprivate func goBack() {
        let _ = navigationController?.popViewController(animated: true)
    }
}

// MARK: - 设置界面
extension SSWBDemoViewController {
    
    /// 重写父类方法
    override func setupUI() {
        super.setupUI()
        // 设置右侧控制器
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
}
